package com.shitou.springai1.user.controller;


import com.shitou.springai1.user.service.RedisVectorStoreService;
import lombok.RequiredArgsConstructor;
import org.springframework.ai.document.Document;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class VectorController {
    private final RedisVectorStoreService redisVectorStoreService;

    @GetMapping("/init")
    public String init(@RequestParam String content) {
          List<Document> documents = redisVectorStoreService.search(content);
        return documents.toString();
    }

}
